#include<iostream>
#include<vector>
using namespace std;

class Solution
{
public:
    int searchInsert(vector<int>& nums, int target)
    {
        int cnt = 0;
        for (int i = 0; i < nums.size(); i++)
        {
            if (nums[i] == target)
            {
                return i;
            }
            if (nums[i] < target)
            {
                cnt++;
            }
        }
        return cnt;

    }
};

int main()
{
    Solution s;
    vector<int> nums{ 1,2,5,6,7,9,11,15,18,39 };
    int ret=s.searchInsert(nums, 10);
    cout << ret << endl;
    return 0;
}


